package com.huiminpay.transaction.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huiminpay.transaction.api.dto.PayChannelDTO;
import com.huiminpay.transaction.entity.PayChannel;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2019-11-15
 */
@Repository
public interface PayChannelMapper extends BaseMapper<PayChannel> {
    @Select("SELECT" +
            " pc.* " +
            "FROM" +
            " pay_channel pc," +
            " platform_pay_channel pfpc," +
            " platform_channel pfc " +
            "WHERE" +
            " pc.CHANNEL_CODE = pfpc.PAY_CHANNEL " +
            " AND pfpc.PLATFORM_CHANNEL = pfc.CHANNEL_CODE " +
            " AND pfpc.PLATFORM_CHANNEL = #{platformChannel}")
    public List<PayChannelDTO> findPayChannelByPlatformChannel(String platformChannel);
}
